<?php
use app\article\model\ArticleConfigModel;
// 这是系统自动生成的article应用公共文件
function longbingGetArticleConfig($uniacid ,$is_update = false)
{
    $key = "longbing_Article_config_" . $uniacid;
    if(hasCache($key ,$uniacid) && empty($is_update)){
        return getCache($key ,$uniacid);
    }
    $model  = new ArticleConfigModel();
    $result = $model->getOne(['uniacid' => $uniacid]);
    if(empty($result))
    {
        $model  = new ArticleConfigModel();
        $result = $model->createOne(['uniacid' => $uniacid]);
        if(!empty($result)) $result =  longbingGetArticleConfig($uniacid);
    }
    if(!empty($result)) setCache($key ,$result ,3600 ,$uniacid);
    return $result;
}
